#include <stdio.h>

int main(void)
{
	int n;
	int a, b, c, input;
	int count=0, primecount=0, Chulsucount=0;
	int prime[450]={2};
	int Chulsu[100];

	for(n=1;n<=1500;n++)
	{
		count = 0;
		for(a=2; a<(2*n+1); a++)
		{
			if((2*n+1)%a == 0)
				count++;
		}
		if(count == 0)
		{
			prime[primecount+1] = (2*n+1);
			primecount++;
		}
	}
	
	scanf("%d", &input);
	for(a=6; a<=input; a++)
	{
		count=0;
		for(c=0; c<=a; c++)
		{
			if(a%prime[c] == 0)
				count++;
			if(prime[c]>a)
				break;
		}
			
		if(count == 2)
		{
			Chulsu[Chulsucount]=a;
			Chulsucount++;
		}
	}

	printf("%d\n\n", Chulsucount);
	for(a=0; a<Chulsucount; a++)
		printf("%d ",Chulsu[a]);
	return 0;
	}
	